package com.richpay.basejava.base15;

/**
 * 电脑
 */
public class Computer {
    public int state = 2;

    public void run() throws LanPingException, MaoYanException {
        if (state == 1)
            throw new LanPingException("电脑蓝屏了");

        if (state == 2)
            throw new MaoYanException("电脑冒烟了");

        System.out.println("电脑运行");
    }

    public void reset() {
        state = 0;
        System.out.println("电脑重启");
    }
}
